
//
//  NSMutableDictionary+Timer.m
//  InitProject
//
//  Created by ZhangYeKun on 2017/2/7.
//  Copyright © 2017年 DTSTON. All rights reserved.
//

#import "NSMutableDictionary+Timer.h"

@implementation NSMutableDictionary (Timer)

- (void)setObject:(id)anObject forKey:(id<NSCopying>)aKey moveObjectAfterSecond:(float)second{
    
    [self setObject:anObject forKey:aKey];
    
    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(second * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
        
        [self removeObjectForKey:aKey];
        
    });
    
}


@end
